package it.polimi.traveldream.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * The primary key class for the schedule database table.
 * 
 */
@Embeddable
public class SchedulePK implements Serializable {
	// default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name = "package", insertable = false, updatable = false, nullable = false)
	private Integer pack;

	@Column(insertable = false, updatable = false, nullable = false)
	private Integer activity;

	public SchedulePK() {
	}

	public SchedulePK(Integer pack) {
		this.pack = pack;
	}

	public Integer getPackage() {
		return this.pack;
	}

	public void setPackage(Integer pack) {
		this.pack = pack;
	}

	public Integer getActivity() {
		return this.activity;
	}

	public void setActivity(Integer activity) {
		this.activity = activity;
	}

	@Override
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SchedulePK)) {
			return false;
		}
		SchedulePK castOther = (SchedulePK) other;
		return (this.pack == castOther.pack) && (this.activity == castOther.activity);
	}

	@Override
	public int hashCode() {
		final Integer prime = 31;
		Integer hash = 17;
		hash = hash * prime + this.pack;
		hash = hash * prime + this.activity;

		return hash;
	}
}